<template>
	<view class="ordersucess">
		<nav-bar isBack  :title="title" ></nav-bar>
		<!-- 顶部 -->
		<view v-if="type==1">
			<view class="imx"><image src="https://manager.ryz1620.com/static/activity/pay_success.png"></image></view>
			<view class="order-tit">
				下单成功！
				<text>￥</text>
				<text>{{money}}</text>
			</view>
		</view>
		<view v-if="type==0">
			<view class="imxs"><image src="https://manager.ryz1620.com/static/my/ons.png"></image></view>
			<view class="order-tit">
				支付失败！
				<!-- <text>订单号：xxxx</text> -->
			</view>
		</view>
		<view class="wrap-itemList" v-if="type==1">
		<view class="itemList flex align-center">
			<view class="sideBarLeft">付款给商家</view>
			<view class="sideBarRight">{{store_name}}</view>
		</view>
		<view class="itemList flex align-center">
			<view class="sideBarLeft">付款金额</view>
			<view class="sideBarRight">{{money}}</view>
		</view>
		<view class="itemList flex align-center">
			<view class="sideBarLeft">支付方式</view>
			<view class="sideBarRight">微信支付</view>
		</view>
		<view class="itemList flex align-center">
			<view class="sideBarLeft">订单编号</view>
			<view class="sideBarRight">{{order_no}}</view>
		</view>
		<view class="itemList flex align-center">
			<view class="sideBarLeft">创建时间</view>
			<view class="sideBarRight">{{$common.formatDate(creation_time)}}</view>
		</view>
		</view>
		<view class="order-btns" v-if="type==1">
			<view class="ktex" @click="getorder">再付款一笔</view>
			<view class="backBtn" @click="index">返回</view>
		</view>
		<view class="order-btn" v-if="type==0">
			<text @click="index">返回首页</text>
		</view>
	</view>
</template>

<script>
import navBar from "@/components/navBar/navBar.vue"
import activity from '@/service/activity.js'
export default {
	components: { navBar },
	
	data() {
		return {
           orderid:'',
		   type:'',
		   title:'',
		   giftShowModal: false, //订单礼包弹窗
		   gifList:[],
		   baseimg:'https://manager.ryz1620.com',
		   prize_type:'',//奖品类型
		   money:'',//付款金额
		   store_name:'',//付款商家
		   order_no:'',//订单号
		   creation_time:'',//创建时间
		}
	},
	onLoad(e) {
		this.$utils.getUrl()
		this.type = e.type
		this.store_name=e.store
		this.money=e.m
		this.creation_time=e.time
		this.order_no=e.no
		if(this.type==1){
			this.title = '下单成功';
		}else{
			this.title = '下单失败';
		}
	},
	methods: {
		index(){
			uni.switchTab({
				url:'/pages/home/index/index'
			})
		},
		getorder(){
			uni.navigateBack({
				delta: 1
			});
		},
		goSkip(url){
			uni.navigateTo({
				url:url
			})
		},
		giftShowClose(e) {
			if(e!=0){
				this.$common.errorToShow(e);
				setTimeout(function(){
					uni.navigateTo({
						url:'/pages_activity/pages/giftBag/giftBag/index'
					})
				},2000);
			}
			this.giftShowModal = false;
		},
		
	}
}
</script>

<style lang="scss" scoped>
.ordersucess{
	width: 100%;height: 100vh;background: #fff;display: flex;flex-flow: column;
}
.imx{
	width: 192rpx;
	height: 192rpx;
	margin:70rpx auto 0 auto;
}
.imxs{
	width: 288rpx;
	height: 232rpx;
	margin: 70rpx auto;
	text-align: center;
}
.order-tit{
	text-align: center;
	font-size: 34rpx;
	padding: 0 30rpx;
	word-wrap: break-word;
	text{
		font-size: 28rpx;
		color: #888;
		display: block;
		margin: 20rpx 0;
	}
}
.order-btns{
	margin:50rpx auto;
	text-align: center;
	line-height:92rpx ;
	.ktex{
		width: 600rpx;
		height: 92rpx;
		background: linear-gradient(270deg, #CB9439 0%, #EBB55C 100%);
		border-radius: 55rpx;
		color: #fff;
		margin-bottom:40rpx;
	}
	.backBtn{
		width: 600rpx;
		height: 92rpx;
		background: #FFFFFF;
		border: 2rpx solid #CB9439;
		border-radius: 55rpx;
		color: #CB9439;
	}
}
.order-btn{
	margin-top: 50rpx;
	text-align: center;
	text{
		display: inline-block;
		padding: 15rpx 50rpx;
		background: #C3AB7C;
		color: #fff;
		margin: 0 30rpx;
		border-radius: 5rpx;
	}
	.ktex{
		background:none;
		border:1px #C3AB7C solid;
		color: #C3AB7C;
	}
}
    .wrap-itemList{
		width: 94%;
		height: auto;
		margin:10rpx auto;
		.itemList{
			width:100%;
			height:90rpx;
			justify-content: space-between;
			.sideBarLeft{
				color: #717171;
			}
			.sideBarRight{
				color:#101010;
			}
		}
	}
	
	.flex{
		display: flex;
	}
	.align-center{
		align-items: center;
	}
	.placeholder-input{
		text-indent: 2rpx;
		font-size: 28rpx;
	}
	.text-overflow{
		overflow:hidden;
		text-overflow:ellipsis;
		-o-text-overflow:ellipsis;
		white-space:nowrap;
	}
</style>